<?php
/**
 * Created by PhpStorm.
 * User: Jerry
 * Date: 2017/1/13
 * Time: 16:02
 */

namespace YMApi\Service;

use YMApi\Repositories\CategoryRepository;

/**
 * Class CategoryService
 * @package SDXApi\Service
 */
class CategoryService
{


	/**
	 * @var CategoryRepository
	 */
	protected static $categoryRepository;

	/**
	 * CategoryService constructor.
	 */
	public function __construct()
	{
		self::$categoryRepository = new CategoryRepository();
	}

	/**
	 * Created by Jerry
	 * @return array|bool
	 */
	public function getCategories()
	{
		return self::$categoryRepository->getCategoryParentList();
	}

	public function getCategoryById($id)
	{
		return self::$categoryRepository->checkCategoryById($id);
	}
}